<%include ../../inc/header.ejs%>
<!-- html主体代码 start -->
<style>
    .lay-w-6{width: 50%;display: block;float: left;}
</style>
<fieldset class="layui-elem-field layui-field-title">
    <legend>数据管理操作</legend>
</fieldset>
<form class="layui-form" action="" id="data-form">
    <div class="lay-w-6">
        <div class="layui-form-item">
            <label class="layui-form-label">设备编码</label>
            <div class="layui-input-block">
                <input value="<% if((typeof obj)!=='undefined'){%><%=obj.code%><%}%>" type="text"
                       name="code" id="model-code" required placeholder="请输入设备编码" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">SN序列号</label>
            <div class="layui-input-block">
                <input value="<% if((typeof obj)!=='undefined'){%><%=obj.sn%><%}%>" type="text"
                       name="sn" id="model-sn" placeholder="请输入SN序列号" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">驻防范围</label>
            <div class="layui-input-block">
                <select name="garrisonId" lay-filter="aihao">
                    <%try{%>
                    <% if(garrison.length>0){%>
                    <% garrison.forEach(function(gar){ %>
                    <option value="<%=gar.id%>" <% if((typeof obj)!=='undefined'){if(obj.garrisonId==gar.id){%> selected <%}}%>><%=gar.name%>/<%=gar.range%>米</option>
                    <%})%>
                    <%}%>
                    <%}catch (e){}%>

                </select>
            </div>
        </div>
    </div>
    <div class="lay-w-6">
        <div class="layui-form-item">
            <label class="layui-form-label">IMEI号</label>
            <div class="layui-input-block">
                <input value="<% if((typeof obj)!=='undefined'){%><%=obj.imei%><%}%>" type="text"
                       name="imei" id="model-imei" placeholder="请输入IMEI号" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">排序</label>
            <div class="layui-input-block">
                <input value="<% if((typeof obj)!=='undefined'){%><%=obj.sort%><%}%>" type="number"
                       name="sort" id="model-sort" placeholder="请输入序号 数字越大越靠前" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">驻防状态</label>
            <div class="layui-input-block">
                <input type="checkbox" name="garrisonStatus" lay-skin="switch" title="开关">
            </div>
        </div>
    </div>

</form>
<!-- html主体代码 end -->
<%include ../../inc/js.ejs%>
<!-- 私有脚本 start -->
<script>
    function getPageVal() {
        var obj = getFrom('#data-form');
        if(!autoRequired('model-',obj)){
            return false;
        }
        return obj;
    }
</script>
<!-- 私有脚本 end -->
<%include ../../inc/footer.ejs%>